<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace Plugin\Attractions\Commerce\Request\Commerce_qualification;

use Hyperf\Validation\Request\FormRequest;

/**
 * 商户资质信息验证数据类
 */
class CommerceQualificationRequest extends FormRequest
{

    public function authorize(): bool
    {
        return true;
    }


    /**
     * 新增数据验证规则
     * return array
     */
    public function rules(): array
    {
        return [
            //商户名称 验证
            'merchant_id' => 'required',
            //资质类型：1-食品经营许可证，2-卫生许可证，3-消防许可证，4-其他证书 验证
            'qualification_type' => 'required',

        ];
    }


    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => '主键ID',
            'merchant_id' => '商户ID',
            'qualification_type' => '资质类型：1-食品经营许可证，2-卫生许可证，3-消防许可证，4-其他证书',

        ];
    }

public function messages(): array
{
    return [
            'id.required' => '必填主键ID',
            'merchant_id.required' => '必填商户ID',
            'qualification_type.required' => '必填资质类型：1-食品经营许可证，2-卫生许可证，3-消防许可证，4-其他证书',

    ];
}
}